﻿using SqlSugar;

namespace TiaoTiaoCode.BasicDbCore
{
    /// <summary>
    /// 仓储
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public abstract class Repository<T> : SimpleClient<T> where T : class, new()
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="context"></param>
        public Repository(ISqlSugarClient context = default!) : base(context)
        {
            //ioc注入的对象
            // base.Context=DbScoped.SugarScope; SqlSugar.Ioc这样写
            // base.Context=DbHelper.GetDbInstance()当然也可以手动去赋值
            //base.Context = context;
            Context = DbFramework.Scope;
        }
    }
}
